package com.es.system.domain;

/**
 * 描述:
 * Old-AgeCareSystem-
 *
 * @author Derek
 * @create 2021-12-09 16:00
 */
public enum SysUserSexEnum {
    MAN(0,"男"),WOMAN(1,"女");

    private Integer code;
    private String title;

    SysUserSexEnum(Integer code, String title){
        this.code = code;
        this.title = title;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public static String getTitleByCode(Integer code){
        if (code == null) {
            return "null";
        }
        SysUserSexEnum[] enums = SysUserSexEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if(code.equals( enums[i].getCode())){
                return enums[i].getTitle();
            }
        }
        return "null";
    }
}
